MColorPalette – Color selection and palette control.


Creation: MColorPalette_New(caption$, x, y, mode)


caption$ - (optional) The title bar caption for the control. Bar is hidden if left empty.

x – Pixel X coordinate for the top left corner of the control.

y – Pixel Y coordinate for the top left corner of the control.

mode – 0=Starts showing color map; 1=Starts showing the custom color palette.


Functions:

MColorPalette_AddColor(index, paletteIndex, argbcolor)

Adds color (argbcolor) to custom palette at paletteIndex (0-255).


MColorPalette_AddHexColor(index, paletteIndex, color$)

Adds color (color$) in hex format AARRGGBB or RRGGBB to custom palette at paletteIndex (0-255).


MColorPalette_ClearSelected(index)

Clears the control's pressed status.


MColorPalette_ConvertHexColor(color$)

Converts color (color$) in hex format AARRGGBB or RRGGBB to argb color value.

Overrides opacity to 100%. Use MFont_HexConvert() instead if undesired.


MColorPalette_ConvertRGBColor(color)

Converts color (color) in argb to hex format RRGGBB color code.


MColorPalette_Delete(index)

Deletes the control.


MColorPalette_Disable(index)

Disables the control.


MColorPalette_Draw(index)

Draws the control to screen.


MColorPalette_Enable(index)

Enables the button.


MColorPalette_GetSelected(index)

Returns whether control is pressed status. 0=no ; 1=yes


MColorPalette_GetColor(index)

Returns the currently typed color code, in argb color value format.


MColorPalette_GetHexColor(index)

Returns the currently typed color code, in hex color code format.


Additional Functionality:


Brightness levels are adjusted by right clicking the color map. The level selected varies depending how high or low on the color map the mouse is.